﻿@using IdentityServer4.Extensions

@{
    string name = null;
    if (!true.Equals(ViewData["signed-out"]))
    {
        name = Context.User?.GetDisplayName();
    }
}

<div class="nav-page">
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">

        <a href="~/" class="navbar-brand">
            <img src="~/icons/identity.png" class="icon-banner" height="32">
            统一授权和认证中心
        </a>

        @if (!string.IsNullOrWhiteSpace(name))
        {
            <ul class="navbar-nav mr-auto">
                <li class="nav-item dropdown">
                    <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">@name <b class="caret"></b></a>

                    <div class="dropdown-menu">
                        <a class="dropdown-item" asp-action="Logout" asp-controller="Account">注销</a>
                    </div>
                </li>
            </ul>
        }

    </nav>
</div>
